import { PredicateFn } from "./interface.ts";

export function takeWhile<T>(array: T[], predicate: PredicateFn<T>): T[] {
  const index = array.findIndex(predicate);
  return array.slice(index);
}
